import React, { PureComponent } from 'react';
import { Spin } from 'antd';
import styles from './index.less';

export default class LoadingWrapper extends PureComponent {
  render() {
    const { loading, children, style } = this.props;

    return (
      <div style={style} className={styles.wrapper}>
        {loading ? <Spin size="large" /> : children}
      </div>
    );
  }
}
